import request from '@/utils/request'

// 查询物料计划列表
export function listMater_plan(query) {
  return request({
    url: '/mes/mater_plan/list',
    method: 'get',
    params: query
  })
}

// 修改-查询物料计划列表
export function newListMater_plan(query) {
  return request({
    url: '/mes/mater_plan/material/list',
    method: 'get',
    params: query
  })
}

// 查询物料计划详细
export function getMater_plan(id) {
  return request({
    url: '/mes/mater_plan/' + id,
    method: 'get'
  })
}

// 新增物料计划
export function addMater_plan(data) {
  return request({
    url: '/mes/mater_plan',
    method: 'post',
    data: data
  })
}

// 新增物料计划
export function newAddMater_plan(data) {
  return request({
    url: '/mes/mater_plan/add',
    method: 'post',
    data: data
  })
}

// 修改物料计划
export function updateMater_plan(data) {
  return request({
    url: '/mes/mater_plan',
    method: 'put',
    data: data
  })
}

// 删除物料计划
export function delMater_plan(id) {
  return request({
    url: '/mes/mater_plan/' + id,
    method: 'delete'
  })
}

// 查询物料计划详细(根据产品id)
export function getReqMater(proId) {
  return request({
    url: '/mes/bom/material/' + proId,
    method: 'get'
  })
}

// 新增采购需求
export function addMatRequirement(data) {
  return request({
    url: '/mes/requirement/purchase',
    method: 'post',
    data: data
  })
}
